package dom;

import bean.admin;
import bean.user;
import cont.contr;


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class admindom extends user  {
    public static void logOutUser(String userid) throws SQLException {
        Connection conn = contr.getConn();
        String sql = "delect  from user where userid=?";
        PreparedStatement pstmt = conn.prepareStatement(sql);
        pstmt.setString(1, userid);
        pstmt.execute();
        pstmt.close();
        conn.close();
    }
    public static void addadmin(String name,String number) throws SQLException {
        Connection conn = contr.getConn();
        String sql = "insert into admin(id,name,number) values(?,?,?)";
        PreparedStatement pstmt = conn.prepareStatement(sql);
        pstmt.setString(2, name);
        pstmt.setString(3, number);
        pstmt.execute();
        pstmt.close();
        conn.close();
    }
}
